<!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0">
    <meta name="generator" content="editplus"/>
    <style type="text/css">
        .content {
            color: #ffffff;
        }
        body , p { padding: 0; margin: 0;}
        .bg {
            background: url('../../images/7fa2d2b310d5333eefa3015b2af71517.jpeg');
            height:680px;
            text-align: center;
        }
        .bg-blur {
            float: left;
            width: 100%;
            background-repeat: no-repeat;
            background-position: center;
            background-size: cover;
            -webkit-filter: blur(10px);
            -moz-filter: blur(10px);
            -o-filter: blur(10px);
            -ms-filter: blur(10px);
            filter: blur(10px);
        }
        .content-front {
            position:absolute;

            width: 100%;
            height:680px;
        }
        .top_head { width: 100%; height: 50px; color: #fff; text-align: center; line-height: 50px; background: rgba(0,0,0,.5)}
        .mess_content { width: 95%; max-height: 680px; margin: 0 auto; padding-top: 10px; text-align: center;}
        .hall-item { display: inline-block; width: 100px; height: 100px; border: 1px solid #ccc; background: url("../../images/chatroombg.png") center 10px no-repeat rgba(255,255,255,0.8); position: relative; margin-right: 10px;}
        .hall-item p { width: 100px; height: 30px; line-height: 30px; position: absolute; bottom: 0px; text-align: center; color: #888888;}
        .item { width: 340px; display: inline-block; text-align: left;}
        .close—btn { display: inline-block; width: 32px; height: 32px; float: right; margin-right: 10px; margin-top: 10px; background: url("../../images/c2.png")}

    </style>
</head>
<body>
<div>
    <div class="bg bg-blur"></div>
    <div class="content content-front">
        <div class="top_head">
            <div class="hall" onclick="showHall()"></div>
            聊天大厅 <a href="JavaScript:;" class="close—btn" onclick="callAndiod()"></a></div>
        <div class="mess_content">
            <div class="item">
                <div class="hall-item">
                    <p>萌娘大厅</p>
                </div>
                <div class="hall-item">
                    <p></p>
                </div>
                <div class="hall-item">
                    <p></p>
                </div>
                <div class="hall-item">
                    <p></p>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
</body>
</html>
<script type="text/javascript" src="../../js/jquery-1.9.1.js"></script>
<script>
    loadHall();
    // 加载大厅数据
    function loadHall(){
        var url = "http://aaa.57810.mom/index.php/chat/getChating";
        $.ajax({
            type : "get",
            url : url,
            dataType : "jsonp",
            data:"{}",
            jsonp: "callback",//传递给请求处理程序或页面的，用以获得jsonp回调函数名的参数名(默认为:callback)
            jsonpCallback:"success_jsonpCallback",//自定义的jsonp回调函数名称，默认为jQuery自动生成的随机函数名
            success : function(json){
                  var item = document.getElementsByClassName('item')[0];
                  var html = "";
                  for(var i=0;i<json.length;i++) {
                       html += "<div class='hall-item'><a href='chat.html?rid="+json[i]['rid']+"&room="+json[i]['name']+"'><p>" + json[i]['name'] + "</p></a></div>";
                  }
                 item.innerHTML = html;
            },
            error:function(){
                alert('fail');
            }
        });
    }

    function callAndiod(){
          android.exitchat();
    }

</script>